package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 文件服务的状态枚举
 * 
 * @author buyi
 * @date 2017-08-25 10:42:04
 * @since v2.0.0
 */
public enum FileServcerStateEnum {
	/** 成功 */
	SUCCESS("2"),
	/** 失败 */
	FAIL("3");

	private String value;

	private FileServcerStateEnum(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean isValue(String value) {
		return StringUtils.equals(getValue(), value);
	}

	public static FileServcerStateEnum fromValue(String value) {
		for (FileServcerStateEnum stateEnum : FileServcerStateEnum.values()) {
			if (stateEnum.isValue(value)) {
				return stateEnum;
			}
		}

		return null;
	}

}
